package com.lm.Builder;

/**
 * 指挥者对象
 */
public class Director {

    private HumanBuilder builder;

    private Director(HumanBuilder builder){
        this.builder = builder;
    }

    /**
     * 产品构建
     * @return
     */
    public Human construct(){
        builder.builderHeader();
        builder.builderHands();
        builder.builderFoot();
        return builder.getResult();
    }

    public static void main(String[] args) {
        WhiteHumanBuilder whiteHumanBuilder = new WhiteHumanBuilder();
        Director director = new Director(whiteHumanBuilder);
        Human human = director.construct();
        System.out.println(human);
    }
}
